﻿using GrainManage.Web.Resources;
using GrainManage.Web.Validation;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace GrainManage.Web.Models.Account
{
    public class RegisterModel
    {
        [Required(ErrorMessageResourceType = typeof(AccountResx), ErrorMessageResourceName = "UserNameRequired")]
        [Display(ResourceType = typeof(AccountResx), Name = "UserName")]
        public string UserName { get; set; }

        [DataType(DataType.Password)]
        [Required(ErrorMessageResourceType = typeof(AccountResx), ErrorMessageResourceName = "PasswordRequired")]
        [Display(ResourceType = typeof(AccountResx), Name = "Password")]
        public string Password { get; set; }

        [DataType(DataType.Password)]
        [Display(ResourceType = typeof(AccountResx), Name = "ConfirmPassword")]
        [Compare("Password", ErrorMessageResourceType = typeof(AccountResx), ErrorMessageResourceName = "ComfirmError")]
        public string ConfirmPassword { get; set; }

        [StringLength(10)]
        [Display(ResourceType = typeof(AccountResx), Name = "RealName")]
        public string RealName { get; set; }

        [DataType(DataType.PhoneNumber)]
        [Display(ResourceType = typeof(AccountResx), Name = "CellPhone")]
        public string CellPhone { get; set; }

        [DataType(DataType.EmailAddress)]
        [Display(ResourceType = typeof(AccountResx), Name = "EmailAddress")]
        public string EmailAddress { get; set; }

        [DataType(DataType.Text)]
        [Display(ResourceType = typeof(AccountResx), Name = "Remarks")]
        public string Remarks { get; set; }

        [Display(ResourceType = typeof(AccountResx), Name = "CheckLoginIP")]
        public bool CheckLoginIP { get; set; }

        public GrainManage.Entities.Encrypt.EncryptFlag EncryptFlag { get; set; }
    }
}